package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-04-20.
 */
@Entity
@Table(name = "login_log", schema = "", catalog = "")
public class LoginLogEntity extends IAcross
{
	public LoginLogEntity()
	{
		super();
	}

	public LoginLogEntity(IAcross ia)
	{
		super(ia);
	}

    private int loglogId;
    private int loginId;
    private String type;
    private Timestamp logDate;
    private int createId;
    private String oldPwd;
    private String newPwd;
    private String ipv4;
    private String ipv6;
    private Integer longitude;
    private Integer latitude;
    private String name;

    @Id
    @Column(name = "loglog_id")
    @GeneratedValue
    public int getLoglogId() {
        return loglogId;
    }

    public void setLoglogId(int loglogId) {
        this.loglogId = loglogId;
    }

    @Basic
    @Column(name = "login_id")
    public int getLoginId() {
        return loginId;
    }

    public void setLoginId(int loginId) {
        this.loginId = loginId;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "log_date")
    public Timestamp getLogDate() {
        return logDate;
    }

    public void setLogDate(Timestamp logDate) {
        this.logDate = logDate;
    }

    @Basic
    @Column(name = "create_id")
    public int getCreateId() {
        return createId;
    }

    public void setCreateId(int createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "old_pwd")
    public String getOldPwd() {
        return oldPwd;
    }

    public void setOldPwd(String oldPwd) {
        this.oldPwd = oldPwd;
    }

    @Basic
    @Column(name = "new_pwd")
    public String getNewPwd() {
        return newPwd;
    }

    public void setNewPwd(String newPwd) {
        this.newPwd = newPwd;
    }

    @Basic
    @Column(name = "ipv4")
    public String getIpv4() {
        return ipv4;
    }

    public void setIpv4(String ipv4) {
        this.ipv4 = ipv4;
    }

    @Basic
    @Column(name = "ipv6")
    public String getIpv6() {
        return ipv6;
    }

    public void setIpv6(String ipv6) {
        this.ipv6 = ipv6;
    }

    @Basic
    @Column(name = "longitude")
    public Integer getLongitude() {
        return longitude;
    }

    public void setLongitude(Integer longitude) {
        this.longitude = longitude;
    }

    @Basic
    @Column(name = "latitude")
    public Integer getLatitude() {
        return latitude;
    }

    public void setLatitude(Integer latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LoginLogEntity that = (LoginLogEntity) o;

        if (createId != that.createId) return false;
        if (loginId != that.loginId) return false;
        if (loglogId != that.loglogId) return false;
        if (ipv4 != null ? !ipv4.equals(that.ipv4) : that.ipv4 != null) return false;
        if (ipv6 != null ? !ipv6.equals(that.ipv6) : that.ipv6 != null) return false;
        if (latitude != null ? !latitude.equals(that.latitude) : that.latitude != null) return false;
        if (logDate != null ? !logDate.equals(that.logDate) : that.logDate != null) return false;
        if (longitude != null ? !longitude.equals(that.longitude) : that.longitude != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (newPwd != null ? !newPwd.equals(that.newPwd) : that.newPwd != null) return false;
        if (oldPwd != null ? !oldPwd.equals(that.oldPwd) : that.oldPwd != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = loglogId;
        result = 31 * result + loginId;
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (logDate != null ? logDate.hashCode() : 0);
        result = 31 * result + createId;
        result = 31 * result + (oldPwd != null ? oldPwd.hashCode() : 0);
        result = 31 * result + (newPwd != null ? newPwd.hashCode() : 0);
        result = 31 * result + (ipv4 != null ? ipv4.hashCode() : 0);
        result = 31 * result + (ipv6 != null ? ipv6.hashCode() : 0);
        result = 31 * result + (longitude != null ? longitude.hashCode() : 0);
        result = 31 * result + (latitude != null ? latitude.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
